package com.jar.exercise.算法.整数反转;

public class Demo {
    public static int reverse(int x) {
        long n = 0;
        while(x != 0) {
            n = n*10 + x%10;
            x = x/10;
        }
        return (int)n==n? (int)n:0;
    }

    public static void main(String[] args) {
        long i = 2147483648L;
        int i1 = (int) i;
        System.out.println(i1);
//        System.out.println(reverse(2147483648));
    }
}
